import { IpcEvent } from 'app/type'
import { ipcRenderer } from 'electron'

export function getStore(key: string, defaultValue?: unknown) {
    return ipcRenderer.invoke(IpcEvent.STORE_GET, key, defaultValue)
}
export function setStore(key: string, value: string) {
    return ipcRenderer.invoke(IpcEvent.STORE_SET, key, value)
}
export function hasStore(key: string) {
    return ipcRenderer.invoke(IpcEvent.STORE_HAS, key)
}
export function resetStore(...keys: string[]) {
    return ipcRenderer.invoke(IpcEvent.STORE_RESET, ...keys)
}
export function deleteStore(key: string) {
    return ipcRenderer.invoke(IpcEvent.STORE_DELETE, key)
}
export function openInEditorStore() {
    return ipcRenderer.invoke(IpcEvent.STORE_OPEN_IN_EDITOR)
}
